{% extends '__base.tpl' %}

{% block head %}
{{super()}}
<!-- build:css -->
<link rel="stylesheet" type="text/css" href="../../../public/css/page/userAddress.css" />
<!-- endbuild -->
{% endblock %}

{% block body %}
<div class="user-bg">
    <div id="box">
        <div class="address-box">
            <div class="address-title">
                <span class="font24">书籍购买</span>
                <a class="blue font12 ml10" href="javascript:history.back()">返回</a>
            </div>
            <div class="all-address">
                <!--地址列表start-->
                <table class="table">
                    <tbody id="addressList"></tbody>
                    <script id="addressList_tpl" type="text/html">
                        <% each data as arr i %>
                        <tr>
                            <td width="10" align="right">
                                <input name="address" class="checkbox" data-id="<%arr.id%>"  data-name="<%arr.name%>"  data-tel="<%arr.tel%>"
                                       data-provinceid="<%arr.provinceId%>"  data-cityid="<%arr.cityId%>"  data-areaid="<%arr.areaId%>"
                                       data-address="<%arr.address%>" data-defaultis="<%arr.defaultIs.toString()%>" data-postcode="<%arr.postCode%>"
                                       onclick="BASE.USER_ADDERSS.modifyAddressPrev(this);BASE.OTHER_BUYBOOK.getExpressTpl(this)"
                                       type="checkbox" />
                            </td>
                            <td width="30" align="center"><%arr.name%></td>
                            <td width="80" align="center"><%arr.tel%></td>
                            <td width="180" align="left"><%arr.provinceName%><%arr.cityName%><%arr.areaName%><%arr.address%></td>
                        </tr>
                        <%/each%>
                    </script>
                </table>
                <!--地址列表end-->
            </div>
            <div class="add-address-box">
                <!--添加-->
                <input name="send-address" class="hide" type="radio" />
                <dl>
                    <dd class="require">地址信息：</dd>
                    <dt>
                        <!--省-->
                        <select id="provinceId" data-id="province_id" class="select"
                                onchange="BASE.COMMON.getArea(3,'cityId',$('#provinceId option:selected').val());BASE.OTHER_BUYBOOK.getExpressTpl(this)">
                            <option value="">请选择省</option>
                        </select>

                        <!--市-->
                        <select id="cityId"  data-id="city_id" class="select ml10"
                                onchange="BASE.COMMON.getArea(4,'areaId',$('#cityId option:selected').val());">
                            <option value="">请选择市</option>
                        </select>

                        <!--区-->
                        <select id="areaId"  data-id="area_id" class="select ml10">
                            <option value="" >请选择区</option>
                        </select>

                        {% include '__address_area_script.html' %}
                    </dt>
                </dl>
                {% include '__address_add.html' %}
            </div>
            <div class="address-bottom buy-book-bottom">
                <div id="bookDetail"></div>
                <script id="bookDetail_tpl" type="text/html">
                    <h2 class="iblock font14 clo6">《<%data.name%>》</h2>
                    <h6 class="iblock font14 ml30 clo6"><%data.author%></h6>
                    <span class="red ml30 clo6">&yen;<%data.price%></span>
                    <span class="car-btn-box ml30">
                        <button class="car-add-btn" onclick="BASE.OTHER_BUYBOOK.addReduceNum(-1)">-</button>
                        <span class="orange font15" data-weight="<%data.weight%>" data-price="<%data.price%>" id="buyNumber"><%data.num%></span>
                        <button class="car-reduce-btn ml10" onclick="BASE.OTHER_BUYBOOK.addReduceNum(1)">+</button>
                    </span>
                    <span class="font18 fright">
                        合计：
                        <span class="orange mr20">
                            &yen;<span  id="buyTotal"><%data.total%></span>
                            <span id="expressPrice">(不含快递)</span>
                        </span>
                        <button class="common-btn" id="saveBtn"
                                onclick="BASE.USER_ADDERSS.addAddress(this,BASE.OTHER_BUYBOOK.buyBook)">支付</button>
                        <button class="common-btn" style="display: none" id="modifyBtn"
                                onclick="BASE.USER_ADDERSS.modifyAddress(this,BASE.OTHER_BUYBOOK.buyBook)">支付</button>
                    </span>
                </script>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block script %}
{{ super() }}
<!-- build:js -->
<script src="../../../public/js/page/user/user_userAddress.js"></script>
<script src="../../../public/js/page/other/other_buyBook.js"></script>
<!-- endbuild -->
{% endblock %}